window: Don't use set_allocation() to store cached values
authorBenjamin Otte <otte@redhat.com>
Mon, 14 Jan 2013 16:59:31 +0000 (17:59 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 14 Jan 2013 17:13:10 +0000 (18:13 +0100)
The window size can be queried on widget->window directly, no need to
store it in widget->allocation.
This change is necessary because gtk_widget_set_allcation() is now
checking invariants that assume it's called from insize
gtk_widget_size_allocate() and that wasn;t the case here.

gtk/gtkwindow.c

index db6eb7af0c5111ca0cc5504d5807451ef2f8e9c6..e0c21a923e55c5717aafffb1596f6633ccb17c44 100644 (file)
@@ -5666,7 +5666,6 @@ gtk_window_configure_event (GtkWidget         *widget,
 
   /*
    * If we do need to resize, we do that by:
-   *   - filling in widget->allocation with the new size
    *   - setting configure_notify_received to TRUE
    *     for use in gtk_window_move_resize()
    *   - queueing a resize, leading to invocation of
@@ -5676,10 +5675,6 @@ gtk_window_configure_event (GtkWidget         *widget,
   
   priv->configure_notify_received = TRUE;
 
-  allocation.width = event->width;
-  allocation.height = event->height;
-  gtk_widget_set_allocation (widget, &allocation);
-
   gdk_window_invalidate_rect (gtk_widget_get_window (widget), NULL, FALSE); // XXX - What was this for again?
 
   _gtk_container_queue_resize (GTK_CONTAINER (widget));
@@ -7176,7 +7171,9 @@ gtk_window_move_resize (GtkWindow *window)
                                   &new_geometry,
                                   new_flags);
 
-  gtk_widget_get_allocation (widget, &allocation);
+  gdk_window_get_position (gdk_window, &allocation.x, &allocation.y);
+  allocation.width = gdk_window_get_width (gdk_window);
+  allocation.height = gdk_window_get_height (gdk_window);
 
   /* handle resizing/moving and widget tree allocation
    */